Skip to content

Add TypeScript SDK and examples for the Skills Extension SEP#71

Open
olaservo wants to merge 8 commits intomainfrom
add-sep-example
Open

Add TypeScript SDK and examples for the Skills Extension SEP#71
olaservo wants to merge 8 commits intomainfrom
add-sep-example

Conversation

@olaservo
Copy link
Copy Markdown
Member

@olaservo olaservo commented Mar 22, 2026

Summary

TypeScript SDK and working examples for the Skills Extension SEP draft. Zero protocol dependencies beyond resources/read.

What it demonstrates

  • skill:// resource convention — multi-segment paths with organizational prefixes (skill://acme/billing/refunds/SKILL.md)
  • skill://index.json — well-known discovery index following the Agent Skills format
  • Extension declarationio.modelcontextprotocol/skills via native SDK registerCapabilities (v1.29.0)
  • Final-segment = name constraint — enforced at discovery time
  • No-nesting constraint — enforced at discovery time
  • SDK wrappers matching the SEP spec — listSkills(), listSkillsFromIndex(), readSkillUri(), readSkillContent(), readSkillManifest(), READ_RESOURCE_TOOL

What's included

Component Path Purpose
SDK typescript/sdk/ Server + client libraries (@modelcontextprotocol/ext-skills)
Server example examples/skills-server/ Discovers skills from disk, registers skill:// resources
Client example examples/skills-client/ 6-step demo exercising discovery, reading, and manifests
Sample skills examples/sample-skills/ 4 skills — 2 single-segment, 2 multi-segment under acme/
Docs examples/README.md Architecture diagrams, URI anatomy, SDK-to-protocol mapping

SEP compliance

Verified point-by-point against PR #69:

  • Extension identifier: io.modelcontextprotocol/skills in capabilities.extensions
  • skill:// URI scheme with SKILL.md explicit in all URIs
  • Final path segment = frontmatter name
  • No-nesting constraint enforced
  • skill://index.json with $schema, type: "skill-md", name, description, url
  • read_resource tool schema matches SEP (server + uri params)
  • Resource template skill://{+skillFilePath} for supporting files
  • size field on SKILL.md resources (SDK v1.29.0)

SDK status

Uses @modelcontextprotocol/sdk v1.29.0 (latest stable). Prior workarounds for extensions capability (_capabilities patching) have been replaced with the native registerCapabilities API. Remaining shims are tracked in the README table.

Test plan

  • cd typescript/sdk && npm install && npm run build && npm test — SDK compiles, 53 tests pass
  • cd examples/skills-server/typescript && npm install && npm run build — Server compiles
  • cd examples/skills-client/typescript && npm install && npm run build — Client compiles
  • node examples/skills-client/typescript/dist/index.js — 6-step demo runs end-to-end
  • Verify 4 skills discovered (code-review, git-commit-review, acme/billing/refunds, acme/onboarding)
  • Verify skill://index.json returns all 4 skills in Agent Skills discovery format

🦉 Generated with Claude Code

olaservo and others added 7 commits April 14, 2026 07:00
Reference implementation demonstrating the Skills Extension SEP with:
- skill:// resource convention with multi-segment paths
- Extension declaration (io.modelcontextprotocol/skills) via SEP-2133
- SEP-2093 shims: resources/metadata, URI-scoped resources/list,
  per-resource capabilities via _meta
- SDK with server-side discovery/registration and client-side wrappers
  (listSkills, readSkillUri, fetchSkillMetadata, READ_RESOURCE_TOOL)
- 4 sample skills: 2 single-segment, 2 multi-segment under acme/
- End-to-end client demo exercising all 7 features

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Each shim function now has a TODO with the specific PR link for
when/if it can be removed. Uses "if" not "when" since the
upstream PRs are drafts not guaranteed to merge.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ASCII diagrams showing: overall system structure, URI anatomy,
discovery flow, SDK-to-protocol mapping, and what's permanent
SEP design vs temporary SDK shims.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Align the reference implementation with PR #69's SEP spec, which defines
skill://index.json as the primary enumeration mechanism and requires zero
protocol dependencies beyond resources/read.

Added:
- skill://index.json well-known discovery index (Agent Skills format)
- generateSkillIndex() server-side, listSkillsFromIndex() client-side
- SkillIndex/SkillIndexEntry types and INDEX_JSON_URI constant
- 53 tests across URI utilities, index round-trip, and client parsing

Removed (SEP-2093 features not in the SEP):
- resources/metadata handler and fetchSkillMetadata()
- Scoped resources/list(uri=...) and listSkillsScoped()
- Per-resource _meta capabilities on all resource registrations
- ResourceCapabilities/ResourceMetadataResult types
- Zod schemas and RequestHandlerRegistrar interface

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Bump @modelcontextprotocol/sdk from 1.27.1 to 1.29.0, which includes
native extensions capability support (typescript-sdk#1811, backport of
#1630) and the missing size field on ResourceSchema (#1575).

- Replace private _capabilities hack in declareSkillsExtension with
  the SDK's native registerCapabilities API
- Add size field to SKILL.md resource metadata in registerSkillResources
- Keep ServerInternals as a deprecated alias for backward compatibility
- Update README shims table to reflect resolved workarounds

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@olaservo olaservo changed the title Add Skills Extension SEP reference implementation Add TypeScript SDK and examples for the Skills Extension SEP Apr 14, 2026
@olaservo olaservo marked this pull request as ready for review April 14, 2026 14:15
@olaservo olaservo moved this from Backlog to In review in Skills Over MCP Working Group Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

1 participant